import matplotlib.pyplot as plt
import numpy as np


plt.rcParams['font.sans-serif']=[u'simHei']

# 随机树生成器种子
np.random.seed(0)

# 负样本
X_neg = np.random.multivariate_normal([1,1],[[1,0.5],[0.5,1]],100)

# 正样本
X_pos = np.random.multivariate_normal([5,5],[[1,-0.5],[-0.5,1]],100)


# 决策边界 从-1到7的等间隔的100个点的数组
x=np.linspace(-1,7,100)
y= -x + 3


# 8*6大小
plt.figure(figsize=(8,6))
plt.scatter(X_neg[:,0],X_neg[:,1],c='b',marker='o')
plt.scatter(X_pos[:,0],X_pos[:,1],c='r',marker='^')
plt.plot(x,y,'g--')
plt.xlabel('特征1')
plt.ylabel('特征2')
plt.legend()
plt.grid(True)
plt.show()